import { getWorkOrderDataInfo } from '@/api/datamanagement'
const dataManagement = {
  state: {
    wordorderData: []
  },
  mutations: {
    SET_WOEKORDERDATA: (state, wordorderData) => {
      state.wordorderData = wordorderData
    }
  },
  actions: {

    // 获取数据源信息
    WorkOrderDataGetInfo({ commit }) {
      return new Promise((resolve, reject) => {
        console.log('WorkOrderDataGetInfo')
        getWorkOrderDataInfo().then(response => {
          console.log('getInfo')
          const data = response.data
          commit('SET_WOEKORDERDATA', data)
          console.log(data)
          resolve(response)
        }).catch(error => {
          reject(error)
        })
      })
    }
  }
}

export default dataManagement
